import java.util.Objects;

// Immutable class 学生
public class Student {
    private final String name; //学生姓名
    private final int preferredQuantity; //希望选择的论文数量
    private final PaperType preferredType; //偏好的论文类型

    public Student(String name, int quantity, PaperType type) {
        this.name = name;
        this.preferredQuantity = quantity;
        this.preferredType = type;
    }

    public int getPreferredQuantity() {
        return this.preferredQuantity;
    }

    public PaperType getPreferredPaperType() {
        return this.preferredType;
    }

    public String getName() {
        return this.name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return preferredQuantity == student.preferredQuantity && Objects.equals(name, student.name) && preferredType == student.preferredType;
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, preferredQuantity, preferredType);
    }
}